import axios from 'axios';

export interface EditUserInfoParams {
  /**
   * 手机号
   */
  phone: any;
  /**
   * 用户id
   */
  userId: any;
}

export interface EditPwdParams {
  oldPassword?: string;
  newPassword?: string;
}

// 修改用户信息
export function editInfo(data: EditUserInfoParams) {
  return axios.put('/user/editIndividualInfo', data);
}

// 上传头像
export function uploadAvatar(data: any) {
  return axios.post('/user/avatar', data, {headers: {'Content-type': 'multipart/form-data'}});
}

// 修改密码
export function editPwd(dataParams: EditPwdParams) {
  return axios.put('/user/editPassword', dataParams);
}
